Mark test using inet_ntoa as thread-unsafe#252
Open
ngoldbaum wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I saw this failure in the CI for #250. I managed to trigger it locally on my Mac by looping that one test for a few dozen test runs.
This issue is explicitly called out in the BUGS section of the darwin
inet_ntoamanpage: https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man3/inet_ntoa.3.htmlThis isn't a problem with glibc because inet_ntoa returns a thread-local string there but it is a problem for musl which also returns a static string.
Rather than trying to parse exactly what situations allow you to use this API with threads, I've just marked the test unconditionally thread-unsafe.
While I was touching this code, I also moved the win32 skip to a static skipif decorator, which is generally preferred over a runtime check in the test body.